package kr.hkit.powerjava.chapter6;

public class Gugudan {
	public static void main(String[] args) {
		/*System.out.printf("%2d * %2d =%2d %n", 2, 1, 2*1);
		System.out.printf("%2d * %2d =%2d %n", 2, 2, 2*2);
		System.out.printf("%2d * %2d =%2d %n", 2, 3, 2*3);
		System.out.printf("%2d * %2d =%2d %n", 2, 4, 2*4);
		System.out.printf("%2d * %2d =%2d %n", 2, 5, 2*5);
		System.out.printf("%2d * %2d =%2d %n", 2, 6, 2*6);
		System.out.printf("%2d * %2d =%2d %n", 2, 7, 2*7);
		System.out.printf("%2d * %2d =%2d %n", 2, 8, 2*8);
		System.out.printf("%2d * %2d =%2d %n", 2, 9, 2*9);
		
		
		caLGuguDan();
		caLreGuguDan();*/
	
		int dan = 9;
		while(dan > 10){
			caLGuguDan(dan);
			dan++;
		}

	}
		
		

	

	private static void caLGuguDan(int dan) {
		int i = 1;
		
		while(i<10){
			System.out.printf("%2d * %2d =%2d %n", dan, i, dan*i);
			i++;
		}
	}

	private static void caLreGuguDan() {
		int i = 9;
		
		while(i>0){
			System.out.printf("%2d * %2d =%2d %n", 2, i, 2*i);
			i--;
		}
				
		
	}

	private static void caLGuguDan() {
		int i=0;
		
		while (i < 10){
			i=i+1;
			System.out.printf("%2d * %2d =%2d %n", 2, i, 2*i);
			
			
		}
		
	}

}
